<?php echo elgg_view('golfscore/title');?>
<div class="list-score content">
<?php
$options = array("golf_course_id" => get_input('cid'), "user_entity_id" => get_input('uid'));
$scores = elgg_get_golf_score($options);
foreach ($scores as $score){
	//$user = get_user($score->user_entity_id);
	echo "<div class='scores' onclick=\"onViewScore('$score->golf_score_id');\">";
	echo "<div class='score-profile' style='float:left;width:74%;margin-right:2%'>";
	echo "<p class='score-user'>$score->course_name</p>";
	echo "<p class='score-date'>$score->input_date</p>";
	echo "</div>";
	echo "<div class='score-r' style='width:16%;float:right;background: #f1f1f1;'>";
	echo "<div class='score-total'>";
	echo "<h4><span class='tee' style='background:$score->tee'></span>".$score -> total_score."</h4>";
	echo "</div>";
	echo "</div>";
	/* echo '<br>';
	echo 'Detail';
	$score_details = elgg_get_golf_score_detail(array('golf_score_id' => $score->golf_score_id));
	foreach ($score_details as $detail){
		echo $detail -> hole;
		echo '|';
		echo $detail -> score;
		echo '<br>';
	} */
	echo "</div>";

	
}
?>
</div>
<script type="text/javascript">
	<?php 
		if (count($scores) > 0){
			$uname = $scores[0]->user_full_name;
		}
	?>
	changeTitle({
				'uname':'<?php echo $uname;?>',
				'pageid':VIEW_USER_SCORE,
			});
</script>

	
<style type="text/css">
	.score-profile,.score-r{
		padding: 2%;
	}
	.score-r{
		height:35px;
		line-height:35px;
	}
	.score-profile img{
		float:left;
		margin-right: 5px;
		width: 35px;height:35px;
	}
	
	@-moz-document url-prefix() { 
		 .score-r{
			height:39px;
			line-height:39px;
		}
		.score-profile img{
			float:left;
			margin-right: 5px;
			width: 39px;height:39px;
		}
	}
	.score-profile .score-user{
		font-weight:bold;
		font-size:.9em;
		color: #02401c;
		margin-bottom:5px;
	}
	.score-profile .score-date{
		font-size: .7em;
		color :#999;
	}
	
	.scores h4{
		font-size: .9em;
		color :#333;
	}
	
	.scores h4 span{
		display:inline-block;
		width: 16px;height:16px;
		margin-right: 5px;margin-top:9px;
		float:left;
	}
	
</style>
